package com.juku2024.juku.adapter

import com.juku2024.juku.R
import com.juku2024.juku.model.CarouselModel
import com.juku2024.juku.tools.ImageUtils
import com.zhpan.bannerview.BaseBannerAdapter
import com.zhpan.bannerview.BaseViewHolder

class TopHomeBannerAdapter : BaseBannerAdapter<CarouselModel>() {

    override fun bindData(holder: BaseViewHolder<CarouselModel>, data: CarouselModel?, position: Int, pageSize: Int) {
        holder.setText(R.id.tv_banner_name, data?.name)
        ImageUtils.loadImageBanner(holder.findViewById(R.id.iv_banner), data?.pic)
    }

    override fun getLayoutId(viewType: Int): Int {
        return R.layout.item_home_banner
    }
}